package com.tql.mall.item.controller;

import com.tql.mall.item.service.ItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: tyk
 * @Date: 2023/5/22 17:44
 * @Description:
 */
@RestController
@RequestMapping("api/item/inner")
@Api("service-item对内暴露接口")
public class ItemApiController {

    @Autowired
    private ItemService itemService;

    /**
     * 获取商品详情
     */
    @GetMapping("{skuId}")
    @ApiOperation("获取商品详情")
    public Map<String, Object> getItem(@PathVariable Long skuId) {
        return itemService.getItem(skuId);
    }
}
